<?php
namespace Home\Model;
use Think\Model;
class GoodattributeModel extends Model{
public function getData($cid,$gid){
		//关联属性表和商品表
		$attr = C('DB_PREFIX').'goodattribute';
		$goods = C('DB_PREFIX').'goods';
		//执行查询语句
		$sql = "select a.AttributeName,a.AttributeDefVal from $attr a join $goods g on a.GoodcategoryId = g.GoodcategoryId where g.GoodId=$gid and g.GoodcategoryId=$cid";
		$data = $this->query($sql);
		//var_dump($cid);
		return $data;
	}
}
?>